home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qlib205.zip / QLIB.ZIP / TEST / TESTF.C < prev    next >
C/C++ Source or Header  |  1997-02-07  |  429b  |  26 lines

  1. #include <qlib.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <math.h>
  5.  
  6. //#define double float
  7.  
  8. void main(void) {
  9.   double f;  //remember to always use double with QLIB
  10.   byte a;
  11.   byte tmpstr[80];
  12.  
  13.   printf("Testing floats\n");
  14.   printf("Enter 0 to quit\n");
  15.   do {
  16.  
  17.     printf("\nEnter a float:");
  18.     gets(tmpstr);
  19.     f=atof(tmpstr);
  20.  
  21.     printf("That's %f or %e\n",f,f);
  22.  
  23.   } while (f!=0.0);
  24. }
  25.  
  26.